import React from 'react'
import {Navigate} from "react-router-dom"

function HocLogin(Com) {
  return (props) => {
    const user = window.localStorage.getItem("user")
    if (!user) {
        return <Navigate to={"/login"}></Navigate>
    }
    return <Com {...props}/>
  }
}

export default HocLogin
